﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MultiplyTableForProst
{
    static public class ProstNumericList
    {
        static private bool IsNumberProst(int enteredNumber)
        {
            if (enteredNumber <= 1)
            {
                return false;
            }
            for (int i = 2; i < enteredNumber; i++)
            {
                if (enteredNumber % i == 0)
                {
                    return false;
                }
            }
            return true;
        }

        static public List<int> CreateProstNumericList(int number)
        {
            List<int> prostNumberList = new List<int>();
            
            for (int i = 2; i <= number; i++)
            {
                if (IsNumberProst(i))
                {
                    prostNumberList.Add(i);
                }
            }
            return prostNumberList;
        }
    }
}
